Reasoning about Relaxed Programs
نویسندگان
چکیده
Approximate program transformations such as task skipping [27, 28], loop perforation [20, 21, 32], multiple selectable implementations [3, 4, 15], approximate function memoization [10], and approximate data types [31] produce programs that can execute at a variety of points in an underlying performance versus accuracy tradeoff space. Namely, these transformed programs trade accuracy of their results for increased performance by dynamically and nondeterministically modifying variables that control their execution. We call such transformed programs relaxed programs — they have been extended with additional nondeterminism to relax their semantics and enable greater flexibility in their execution. We present programming language constructs for developing and specifying relaxed programs. We also present proof rules for reasoning about properties of relaxed programs. Our proof rules enable programmers to directly specify and verify acceptability properties that characterize the desired correctness relationships between the values of variables in a program’s original semantics (before the transformation) and its relaxed semantics. Our proof rules also support the verification of safety properties (which characterize desirable properties involving values in only the current execution). The rules are designed to support a reasoning approach in which the majority of the reasoning effort uses the original semantics. This effort is then reused to establish the desired properties of the program under the relaxed semantics. We have formalized the dynamic semantics of our target programming language and the proof rules in Coq, and verified that the proof rules are sound with respect to the dynamic semantics. Our Coq implementation enables developers to obtain fully machine checked verifications of their relaxed programs.
منابع مشابه
(Relative) Safety Properties for Relaxed Approximate Programs
Researchers have recently begun to explore a new class of program transformations called approximate program transformations. These program transformations take an existing program and produce a new, relaxed approximate program that trades accuracy of its results for increased performance. In this paper, we explore how developers can use relational reasoning to verify relative properties of rel...
متن کاملProving acceptability properties of relaxed nondeterministic approximate programs Citation
Approximate program transformations such as skipping tasks [29, 30], loop perforation [21, 22, 35], reduction sampling [38], multiple selectable implementations [3, 4, 16, 38], dynamic knobs [16], synchronization elimination [20, 32], approximate function memoization [11], and approximate data types [34] produce programs that can execute at a variety of points in an underlying performance versu...
متن کاملParameterized Memory Models and Concurrent Separation Logic (extended version)
Formal reasoning about concurrent programs is usually done with the assumption that the underlying memory model is sequentially consistent, i.e. the execution outcome is equivalent to an interleaving of instructions according to the program order. However, memory models in reality are weaker in order to accommodate compiler and hardware optimizations. To simplify the reasoning, many memory mode...
متن کاملLOLCAT: Relaxed Linear References for Lock-free Programming1 Extended version
A linear reference is a reference guaranteed to be unaliased. This is a powerful property that simplifies reasoning about programs, but is also a property that is too strong for certain applications. For example, lock-free algorithms, which implement protocols to ensure safe concurrent access to data structures, are generally not typable with linear references as they involve sharing of mutable...
متن کاملTrace-Based Semantics and Reasoning for Concurrent Programs
Reasoning about concurrent programs is difficult due to the intricate interactions among agents. In general, concurrency can be classified into two categories: shared memory model and message-passing model. For shared memory model, in order for better performance and lower energy consumption, modern multi-core architectures allow out-of-order executions; and for different usage scenarios, diffe...
متن کامل